package org.sang.bbbig.service;

import org.sang.bbbig.dao.StudentDao;
import org.sang.bbbig.model.Student;
import org.sang.bbbig.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuService {
    @Autowired
    StudentDao studentDao;

    public int addstud(Student student){
        return studentDao.addstudent(student);
    }

    public int updatestud(Student student){
        return studentDao.update(student);
    }

    public int deletstud(int id){
        return studentDao.delete(id);
    }

    public Student getById(int id){
        return studentDao.quiery(id);
    }

    public List<Student> getall( ){
        return studentDao.allStudent();
    }

    public List<User> login1(){return studentDao.nickandpwd();}
}
